Can't Rollback Solution - visual-studio-2012

I made some changes to my ASP.NET MVC 4 project that introduced a bug, so I wanted to rollback my project to the last check-in. This check-in works; it doesn't have any broken code. So I used the "Get Specific Version" option, navigated to my last check-in, and rolled it back.
It doesn't revert my code to my last check-in's code. It just puts a little red check mark next to all of the files that contain my broken code with a tooltip saying "Checked out to me".
So I decided to rollback to my very first check-in. Some conflicts auto-resolve; I keep all of the server's versions of files when it prompts me to. It doesn't revert my code to my very first check-in's code. What am I missing; how do I load the code from my last successful check-in?

I ended up figuring out how to fix this myself: after navigating to View > Team Explorer, I had eight Pending Changes that were hidden. Manually right-clicking these and selecting "Undo" reverted the files to the last successful check-in. Pretty basic stuff, but I figured I would post an answer rather than deleting my question entirely, because the process is a little confusing for a beginner (like myself).

Related

IntelliJ: Lost files after "Update project" and can't find them on Local history

I have a nodjs project and i use IntelliJ to run it. Lately the project structure is not appearing as it used to, as if the project was not compiling. So, while searching for answeres, I clicked on the "Update project" button on the right top, but quickly realised it was going to update based on what was on the remote repo.
I've been developing for a few weeks without a single commit because my company asked me to (don't ask why), and the code had sensible data so I didn't have a backup.
After clicking that button, IntelliJ asked me if I wanted to merge my project files with the remote ones, I just pressed Cancel, and that was enough for IntelliJ to merge my entire project and lose a bunch of files I've been working with.
Suprisingly, they're not even on the Local History list. Even though it says "279 files" there I can't click or find any of the files.
Despite not being able to find them, I went to the changes.storageData file under IntelliJIdea2017.2\system\LocalHistory, searched for the names of the files I'm looking for, and found them all there, which makes me think there's still a way of finding them.
So, does anyone know where I can find deleted files after pressing the git "Update project" button on IntelliJ when they're not on the Local History file list?
Thanks a lot in advance!
As I understand, the files were not committed, so Update could not delete them, because git merge/rebase do not start when there are uncommitted changes (see e.g. this question)
They were probably automatically stashed before the update, and not unstashed because the update was actually canceled.
So the first place to check is git stash VCS - Git - Unstash... or Shelf (if Update project is configured to use Shelf)

Disable P4V Auto Refresh of “Reconcile Offline Work” If Window is Left Open

If I do "Reconcile Offline Work" in P4V, after a while the reconciling will finish and a window will eventually pop up showing the files that were modified, added, or removed. Sometimes I know the reconciling will take a few minutes or more based on the huge number of files in the directory, so I move on and start working on something else, and I expect that the reconciling will be done when I return later. However, sometimes, when I go back to P4V several minutes later, I see the window filled in with all of the modified, added, and removed files for a brief moment before they get blanked out and the scan seems to start all over again.
This can be quite aggravating since I'm trying to avoid having to sit around and wait for the reconciling to complete, but I end up having to wait for multiple reconciles when I only want to do it once.
Any ideas as to what causes this or how to turn off this repeated reconciling when I only want to reconcile once?
I'm using the "2014.3" version.
I did a bit of additional searching on this and finally stumbled upon the answer!
This is bug #70465: https://www.perforce.com/perforce/doc.current/user/p4vnotes.txt
#1171326 (Bug #70465)
There is now a preference to disable global refresh affecting the Reconcile
Offline Work dialog. Default is to continue allowing global refresh to
update the dialog. The preference can be found on the Behavior page in
preferences.
Updating to a newer version (2015.1 or newer) will allow me to disable the global refresh in the Preferences/Behavior menu.

In Visual Studio 2012, how can I set a default related work item for TFS commits?

I'm working on refactoring a single code file from a TFS repository. I'm doing this refactor in chunks, making regular small commits. Our TFS policy requires me to associate every commit with a work item.
This means that every few minutes, when I right-click the code file and click Check In Pending Changes, I'll also have to click Add a Work Item by ID underneath Related Work Items, type in a number, and hit enter. The work item thing starts to get pretty tedious after a dozen commits on the same file and same work item in the space of an hour.
Above: The work item dialog I'm referring to, right at the end.
Is there some way to have a work item already specified by default, so I can just start the Check In process and have it already there?
I'll be working with this one file and this one work item for the next few days with lots of committing. If setting this up takes a few minutes and is fiddly, that's fine. It will be worth the time.
I've asked the TFS Product Team for this feature in the past (to remember the last work item I associated with a check-in). But AFAIK this is not currently possible.

Undo checkin in TFS using visual studio 2012: rollback will not give me my pending changes back

I accidentally pressed the Checkin button when I had a list of all my pending changes (in several solutions) open (and I had disabled the confirmation prompt a few years ago, have restored it now though).
I know I can do a rollback of the specific changeset, but this will not give me back my checked out items as it will just overwrite the changes of the changeset with new changes.
Does anybody know of a way to undo the checkin and get my checked out items and changes back?
Perhaps there is an extension to do a rollback, keep al the changes locally and check out those files again.
Or there is another automated way to keep al the changes and check out the files (manually checking out each file is to much work).
Edit
There doesn't seem to be a perfect way. For me the best solution was to 'Rollback the rollback'as stated in https://stackoverflow.com/a/24896432/1343595

TFS How to enable the confirmation dialog pop when undoing pending changes in visual studio

I am following this blog post:
TFS Pending Changes – Ignoring Files which are Identical to the Originals
But I do not get the dialogue shown in step 3 which asked for confirmation regarding the undo. Where can I turn this on within visual studio?
Please do not do this.
I loathe the advice given to you in this blog post. It is super dangerous to get into the habit of asking the system to undo all your changes and then hitting no to not actually undo your changes. You fat finger this one time and accidentally click "yes to all" and you have lost all your work. Oops!
I think that you will be much happier and much safer if you simply let the system do this work for you instead of relying upon a workaround to make this work:
Simply use tfpt uu or tf uu to undo unchanged files.

Resources