Take me back, please! - Git tricks (1)

git reflog
git reset HEAD@{index}
# Doesn’t modify the index or the working tree, leaving your changes staged for commit.
git reset --soft

# Use with caution, as it resets both the index and working tree. Uncommitted changes and all commits after will be removed.

git reset --hard

Note

--

--

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