Skip to main content
Rollback to Revision 4
Source Link
Cerbrus
  • 73.3k
  • 19
  • 138
  • 151

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 
added 1 character in body
Source Link
enb081
  • 4.1k
  • 12
  • 45
  • 66

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 
Added syntax highlighting, removed horizontal scrolling.
Source Link
user456814
user456814

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping the changes you made. 
git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping the changes you made. 

On SourceTree (GUI for GitHub), you may right-click the commit and do a 'Reverse Commit'. This should undo your changes.

On the terminal:

You may alternatively use:

git revert 

Or:

git reset --soft HEAD^ # Use --soft if you want to keep your changes. git reset --hard HEAD^ # Use --hard if you don't care about keeping your changes. 
Copy edited. Added some context.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
Fixing the git revert command so it works
Source Link
GergelyPolonkai
  • 6.5k
  • 6
  • 41
  • 70
Loading
Source Link
Varun Parakh
  • 241
  • 1
  • 4
  • 10
Loading
Post Made Community Wiki by Varun Parakh