Sunday, April 19, 2020

Video Tutorial: How to uncommit or unstage your file using git

Hello guys, Today in this post I am going demonstrate you that how could you uncommit or revert file changes using git. During your git commits sometime you realise that you have mistakenly commit the file and you wanted to uncommit or unstage that file. So follow the simple and easy steps below:

  1. Add your file to the que using this command git add . or git add <file name>
  2. Add your file to commit using this command git commit -am "first commit" (commit all file with message) [😥 Oh gosh I did something wrong]
  3. Type this command git reset HEAD~1 to uncommit or unstated your file.
  4. Type git status and you'll notice that you are in previous state. (✔)

Video demo:

If you like this video tutorial then please let me know by commenting on this video and share this with other developers. Stay tuned until the next post.

No comments:

Post a Comment