TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1205 671
✅ Git & GitHub Interview Questions & Answers (Part 2) 🧠💻

1️⃣6️⃣ What is a Tag in Git?
A:
A tag marks a specific point in history, often used for releases (e.g., v1.0).

1️⃣7️⃣ Difference between Soft, Mixed, and Hard Reset? 
- git reset --soft → Moves HEAD, keeps changes staged 
- git reset --mixed (default) → Moves HEAD, unstages changes 
- git reset --hard → Removes all changes

1️⃣8️⃣ What is Git Revert?
A:
Reverts a commit by creating a new one that undoes changes, keeping history intact.

1️⃣9️⃣ What is Cherry Pick? 
A:
Apply a specific commit from one branch to another without merging the whole branch.

2️⃣0️⃣ What is Git Stash?
A:
Temporarily saves uncommitted changes so you can switch branches safely.

2️⃣1️⃣ What is HEAD in Git? 
A:
A pointer to the current branch reference or latest commit in your working directory.

2️⃣2️⃣ What is the difference between origin and upstream?
- origin: Default remote repo you cloned from 
- upstream: Original repo you forked from (used in collaboration)

2️⃣3️⃣ What is Fast-forward Merge?
A:
When no divergence, Git just moves the branch pointer forward — no new commit needed.

2️⃣4️⃣ Git Fetch vs Git Pull
- Fetch: Downloads changes without merging
- Pull:  Fetch + Merge in one step

2️⃣5️⃣ How to Undo Last Commit? 
git reset --soft HEAD~1   # Keeps changes staged
git reset --hard HEAD~1   # Discards changes completely

💬 Tap ❤️ for more!
  • ❤ 6
More from @coding_interview_preparation
  1. Oct 12, 2026Java Coding Interview Questions Easy 1. Reverse a string without using a built-in reverse…
  2. Oct 10, 2026100 SQL interview questions
  3. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  4. Oct 6, 2026document post
  5. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  6. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →