Answers for "git uncommiting last changes"

3

git revert uncommitted changes

# Revert changes to modified files.
git reset --hard

# Remove all untracked files and directories.
# '-f' is force, '-d' is remove directories.
git clean -fd
Posted by: Guest on February-11-2021
1

git uncommit last commit but keep changes

# https://stackoverflow.com/a/44672195/3013522
git reset --soft HEAD~
Posted by: Guest on December-07-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language