How do I undo ‘git add’ before commit? (unstage) 🔙

1.) Undo ‘git add’ for a specific file 📄

Type into terminal:

 git reset <file>

This unstages the current file (the stuff listed in ‘git status’) without changing any actual code changes.

2.) OR unstage all files 📂

git reset

This does the same but for all files — so it uncommits them while still keeping the actual changes.

👏 THANKS: I appreciate your claps cause it takes time to write these free articles.

⚠️ 💻 IMPORTANT: If you’re building a webapp or website , it’s important you also think about:

  1. 🎥 Embedding a Youtube video into your website

2. 👥 Adding a thumbnail for sharing on social media:

3. 🎵 Play Audio on your HTML website

4. ✅ Free resources for images, icons, and more on your website

5. 🖼 Adding an icon to your website tab (HTML, favicon)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store