Nasrul Hazim Bin Mohamad

Git: Undo

May
13

Here are some undo commands, depending on situation.

# To go back to staging from commit
git reset --soft HEAD~

# Unstaging
git reset HEAD <file>

# Undo Changes Made to the File
git checkout -- <file>

Leave a Reply

Your email address will not be published. Required fields are marked *

three × three =